package com.salon.client;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.salon.client.beans.ClientBean;
import com.salon.client.beans.IncomeBean;
import com.salon.client.beans.IncomeMaterialsBean;
import com.salon.client.beans.MasterBean;
import com.salon.client.beans.MaterialBean;
import com.salon.client.beans.ParentPagingLoadResult;
import com.salon.client.beans.PriceBean;
import com.salon.client.beans.ProcedureBean;
import com.salon.client.beans.WhereBean;
import com.salon.client.beans.WorkDayBean;
import com.salon.server.WorkDayManager;
import com.salon.server.db.DBUtils;

/**
 * The client side stub for the RPC service.
 */
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
	public void login(String username, String password) throws ServiceException;

	public void logout() throws ServiceException;

	public void register(String username, String password, String name)
			throws ServiceException;
	
	public ParentPagingLoadResult<ClientBean> getClients(int offset, int limit, List<WhereBean> wheres) throws ServiceException;
	
	public void addClient(ClientBean bean) throws ServiceException;
	
	public ParentPagingLoadResult<MasterBean> getMasters(int offset, int limit, List<WhereBean> wheres) throws ServiceException;
	
	public void addMaster(MasterBean bean) throws ServiceException;
	
	public ParentPagingLoadResult<MaterialBean> getMaterials(int offset, int limit, List<WhereBean> wheres) throws ServiceException;
	
	public void addMaterial(MaterialBean bean) throws ServiceException;
	
	public void deleteItem(String table, int id) throws ServiceException;
	
	public ParentPagingLoadResult<IncomeBean> getIncomes(int offset, int limit) throws ServiceException;
	
	public IncomeMaterialsBean addIncomeMaterial(IncomeMaterialsBean bean) throws ServiceException;
	
	public void addIncome(IncomeBean bean) throws ServiceException;
	
	public ParentPagingLoadResult<PriceBean> getPrice(int offset, int limit, List<WhereBean> wheres) throws ServiceException;
	
	public void addPrice(PriceBean bean) throws ServiceException;
	
	public void updateClient(ClientBean bean) throws ServiceException;
	
	public void updateMaster(MasterBean bean) throws ServiceException;
	
	public IncomeMaterialsBean addUsedMaterial(IncomeMaterialsBean bean) throws ServiceException;
	
	public ProcedureBean addProcedure(ProcedureBean bean) throws ServiceException;
	
	public ParentPagingLoadResult<ProcedureBean> loadProcedures(int offset, int limit) throws ServiceException;
	
	public List<WorkDayBean> getWorkDays(int year, int month) throws ServiceException;
	
	public void addWorkDay(int masterId, int day, int month, int year) throws ServiceException;
	
	public void deleteWorkDay(int masterId, int day, int month, int year) throws ServiceException;
	
	public void updateMaterial(MaterialBean bean) throws ServiceException;
	
	public Map<Date, Map<MasterBean, ProcedureBean>> getProceduresForDay(Date date, int offset) throws ServiceException;
	
	public ParentPagingLoadResult<IncomeMaterialsBean> loadCurrentMaterials(int offset, int limit, List<WhereBean> wheres) throws ServiceException;
	
	public void calcCurrentMaterial() throws ServiceException;
	
	public ParentPagingLoadResult<IncomeMaterialsBean> getOutcomeMaterials(int offset, int limit, List<WhereBean> wheres)
	throws ServiceException;
	
	public void addOutcomeMaterial(IncomeMaterialsBean bean) throws ServiceException;
	
	public void updateProcedure(ProcedureBean bean) throws ServiceException;
}
